#include "quadric.hh"

Quadric::Quadric (const Vector3f& pos, const Vector3d& rotate, Bounding* bounding, Type t):
  Object (pos, rotate, bounding),
  quadric_ (gluNewQuadric ()),
  type_ (t)
{
  assert (quadric_);
}

void
Quadric::dispatch () const
{
  glColor3ub (255, 255, 255);
  glTranslated (pos_ (2), pos_ (1), pos_ (0));
  switch (type_)
  {
  case Sphere:
    gluSphere (quadric_, ((BoundingSphere*) bounding_)->radius (), 10, 10);
    break;
  default:
    std::cout << "Quadric display, unhandled type: " << type_ << std::endl;
    break;
  }
}
